import com.qi.dao.UserMapper;
import com.qi.pojo.User;
import com.qi.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

/**
 * @author zjq
 * @date 2020/3/11 15:46
 */
public class UserMapperText {
    @Test
    public void findUser() {
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        User userList = mapper.getUserById(1);
        System.out.println(userList);

        //select * from mybatis.user where id=#{id}
        //类型处理器
        //select id,name,pwd from mybatis.user where id=#{id}
        sqlSession.close();
    }

}
